function newPurchase() {
	document.getElementById( "action" ).value = "addpurchase";
	document.getElementById( "form1" ).submit();
}

function removePurchase( pid ) {
	document.getElementById( "action" ).value = "removepurchase";
	document.getElementById( "purchaseid" ).value = pid;
	document.getElementById( "form1" ).submit();
}